__kernel void image_rotate(__global int *src_data,__global int *dest_data,
	int W, int H, float sinTheta, float cosTheta) {
	
	const int ix = get_global_id(0);
	const int iy = get_global_id(1);
	
	float xPos = cosTheta*(ix - W/2) + sinTheta*(iy - H/2) + W/2;
	float yPos = cosTheta*(iy - H/2) - sinTheta*(ix - W/2) + H/2;
	
	if (( ((int)xPos>=0) && ((int)xPos< W)) && (((int)yPos>=0) && ((int)yPos< H)))
	{
		int y = (int)(floor(yPos));
		int x = floor(xPos);
		dest_data[iy*W+ix]=src_data[y*W+x];
	}
}